home *** CD-ROM | disk | FTP | other *** search
- package Code.FIELD.helpers
- {
- import Code.FIELD._dq803;
- import Code.FIELD.body._kc461;
- import Code.FIELD.body._wx790;
- import Code.LIB._rs402;
- import Code.OPTIONS._gs337;
- import flash.display.Shape;
- import flash.events.Event;
- import flash.events.MouseEvent;
- import flash.filters.BitmapFilterQuality;
- import flash.filters.GlowFilter;
- import flash.geom.Point;
-
- public class _dm218
- {
- public static const stNone:int = 0;
-
- public static const stSelected:int = 1;
-
- public var iOff:Boolean = false;
-
- private var iField:_dq803;
-
- private var iBrunch:Array;
-
- private var iTarget:_kc461;
-
- private var iTimer:int;
-
- private var iState:int;
-
- private var iShape:_kc461;
-
- public function _dm218(param1:_dq803)
- {
- iOff = false;
- super();
- iField = param1;
- iBrunch = new Array();
- iField.addEventListener(MouseEvent.MOUSE_MOVE,_up587);
- iField.addEventListener(Event.ENTER_FRAME,onEnterFrame);
- iField.addEventListener(MouseEvent.MOUSE_OUT,_up587);
- iField.addEventListener(MouseEvent.MOUSE_OVER,_up587);
- }
-
- private function setSelection(param1:_kc461, param2:Boolean) : void
- {
- var _loc3_:GlowFilter = null;
- if(param2 == false)
- {
- param1._pr238.m_userData.display.filters = null;
- }
- else
- {
- _loc3_ = new GlowFilter(_gs337.cWhite);
- _loc3_.blurX = _loc3_.blurY = 3 * _rs402._oy577;
- _loc3_.color = 16777215;
- _loc3_.strength = 2.4;
- _loc3_.quality = BitmapFilterQuality.HIGH;
- _loc3_.inner = true;
- param1._pr238.m_userData.display.filters = [_loc3_];
- }
- }
-
- public function get brunch() : Array
- {
- if(iBrunch)
- {
- return iBrunch.slice(0,iBrunch.length);
- }
- return [];
- }
-
- private function _he665() : void
- {
- var _loc1_:Point = null;
- var _loc2_:Point = null;
- var _loc3_:Array = null;
- var _loc4_:int = 0;
- var _loc5_:Object = null;
- iTarget = null;
- _loc1_ = new Point(iField.mouseX,iField.mouseY);
- _loc2_ = iField.localToGlobal(_loc1_);
- _loc3_ = iField.getObjectsUnderPoint(_loc2_);
- _loc4_ = 0;
- while(_loc4_ < _loc3_.length)
- {
- _loc5_ = _loc3_[_loc4_];
- if(_loc5_ is Shape)
- {
- if(_loc5_.parent.parent is _wx790)
- {
- iTarget = _wx790(_loc5_.parent.parent).iShape;
- }
- }
- _loc4_++;
- }
- }
-
- private function _yx620(param1:Boolean) : void
- {
- var _loc2_:int = 0;
- var _loc3_:_kc461 = null;
- _loc2_ = 0;
- while(_loc2_ < iBrunch.length)
- {
- _loc3_ = iBrunch[_loc2_];
- setSelection(_loc3_,param1);
- _loc2_++;
- }
- if(param1 == false)
- {
- iBrunch = null;
- }
- }
-
- public function _dx150() : void
- {
- iField.removeEventListener(MouseEvent.MOUSE_MOVE,_up587);
- iField.removeEventListener(Event.ENTER_FRAME,onEnterFrame);
- iField.removeEventListener(MouseEvent.MOUSE_OUT,_up587);
- iField.removeEventListener(MouseEvent.MOUSE_OVER,_up587);
- }
-
- public function _up587(param1:MouseEvent) : void
- {
- var _loc2_:_kc461 = null;
- if(iOff)
- {
- return;
- }
- if(param1.target is _wx790)
- {
- _loc2_ = _wx790(param1.target).iShape;
- if(iShape != _loc2_)
- {
- iShape = _loc2_;
- iTimer = 30;
- iState = stSelected;
- }
- }
- else if(iBrunch)
- {
- _yx620(false);
- iShape = null;
- iState = stNone;
- }
- }
-
- public function onEnterFrame(param1:Event) : void
- {
- var _loc2_:Array = null;
- if(iOff)
- {
- return;
- }
- _he665();
- switch(iState)
- {
- case stNone:
- if(iTarget)
- {
- iTimer = 6;
- iShape = iTarget;
- iState = stSelected;
- }
- break;
- case stSelected:
- if(++iTimer > 6)
- {
- _loc2_ = iField.iWorld.iContactSolver._hd293(iShape);
- iTimer = 0;
- if(_loc2_.length >= 3)
- {
- _le236(_loc2_);
- }
- else if(iBrunch)
- {
- _yx620(false);
- }
- }
- }
- }
-
- public function _le236(param1:Array) : void
- {
- if(iBrunch)
- {
- _yx620(false);
- }
- iBrunch = param1;
- _yx620(true);
- iState = stSelected;
- }
- }
- }
-
-